//
//  DHOrderButton.m
//  精品酒店
//
//  Created by DIANGHONG on 2018/5/9.
//  Copyright © 2018年 DIANGHONG. All rights reserved.
//

#import "DHOrderButton.h"
@interface DHOrderButton()
@property (weak, nonatomic) IBOutlet UILabel *title;
@property (weak, nonatomic) IBOutlet UIView *selectedView;

@end
@implementation DHOrderButton

- (void)setSelected:(BOOL)selected{
    [super setSelected:selected];
    
    self.selectedView.backgroundColor = selected ? UIColor.redColor : UIColor.whiteColor;
}


+ (instancetype)orderButtonWithFrame:(CGRect)frame title:(NSString *)title
{
    
    UINib *nib = [UINib nibWithNibName:@"DHOrderButton" bundle:nil];
    
    DHOrderButton *button = [nib instantiateWithOwner:nil options:nil][0];
    button.frame = frame;
    button.title.text = title;
    
    return button;
}
@end
